<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>事务流程查询</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function toUnicode(s){ 
	          return s.replace(/([\u4E00-\u9FA5]|[\uFE30-\uFFA0])/g,function(newStr){
	            return "\\u" + newStr.charCodeAt(0).toString(16); 
	　　　　　　}); 
	　　　　} 
		function CheckRight(di) {
            var dropOption = document.getElementById("wname"); 
            if (dropOption.options.length == 1 && dropOption.options[0].text == "所有流程") {
                alert("您没有该权限！");
                return false;
            }
            else {
                var strUrl = di+"/ta/BResult/list?";
                strUrl += "startDate=" + $("#startDate").val();
                strUrl += "&endDate=" + $("#endDate").val();
                strUrl += "&priority=" + $("#priority").val();
                strUrl += "&name=" + toUnicode($("#name").val());
                strUrl += "&wname=" + toUnicode($("#wname").val());
                strUrl += "&iid=" + $("#iid").val();
                
                strUrl += "&isComplete=";
                if ($("#isComplete").attr('checked')) {
                    strUrl += "on";
                }
                strUrl += "&notComplete=";
                if ($("#notComplete").attr('checked')) {
                    strUrl += "on";
                }
                strUrl += "&isCommand=" ;
                if ($("#isCommand").attr('checked')) {
                    strUrl += "on";
                }
                strUrl += "&notCommand=";
                if ($("#notCommand").attr('checked')) {
                    strUrl += "on";
                }
                strUrl += "&isStop=";
                if ($("#isStop").attr('checked')) {
                    strUrl += "on";
                }
                strUrl += "&notStop=";
                if ($("#notStop").attr('checked')) {
                    strUrl += "on";
                }
                location = strUrl;
                
            }
        }
	</script>
</head>
<body>
	<h3 align="center">输入查询条件</h3>
	<form  name="queryForm" action="" method="post">
		<table class="table table-striped table-bordered table-condensed">
			<tr>
				<td>业务类型：</td>
				<td>
					<select id="wname" name="wname" style="width: 200px;">
						<option value="">所有业务</option>
						<c:forEach items="${ls}" var="ls">
							<option value="${ls}">${ls}</option>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td>优先级：</td>
				<td>
					<select id="priority" name="priority" style="width: 200px;">
						<option value="" selected="selected">全部</option>
						<option value="0">普通</option>
						<option value="1">加急</option>
						<option value="2">特急</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>申请单位（个人）：</td>
				<td><input  name="name" id="name" style="width: 200px;" value="" /></td>
			</tr>
			<tr>
				<td>办件编号：</td>
				<td><input name="iid" id="iid" style="width: 200px;" value="" /></td>
			</tr>
			<tr>
				<td>时间段：</td>
				<td>
					自<input id="startDate" readonly="readonly"  class="input-medium Wdate " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
					到<input id="endDate" readonly="readonly"  class="input-medium Wdate " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
				</td>
			</tr>
			<tr>
				<td>是否办结：</td>
				<td><input type="checkbox"  id="isComplete" checked />已办结<input  id="notComplete" type="checkbox" checked />未办结</td>
			</tr>
			<tr>
				<td>是否经手：</td>
				<td><input type="checkbox"  id="isCommand" checked />已经手<input  id="notCommand" type="checkbox" checked />未经手</td>
			</tr>
			<tr>
				<td>是否终止：</td>
				<td><input type="checkbox"  id="notStop" checked />已终止<input  id="isStop" type="checkbox" checked />未终止</td>
			</tr>
			<tr>
				<td colspan="2"><div align="center"><input id="btnCancel" class="btn" type="button" onclick="CheckRight('${ctx}')" value="查 询"/></div></td>
			</tr>
		</table>
	</form>
</body>
</html>